package com.qf.fmall.user.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.util.RawValue;
import com.qf.fmall.user.entity.UserAddr;
import com.qf.fmall.user.service.IUserAddrService;
import com.qf.fmall.vo.ResultVo;
import org.intellij.lang.annotations.JdkConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author leon
 * @since 2024-01-19
 */
@CrossOrigin
@RestController
@RequestMapping("/useraddr")
public class UserAddrController {

    @Autowired
private IUserAddrService userAddrService;

    @GetMapping("/list")
    public ResultVo list(Integer userId){

        List<UserAddr> data = userAddrService.list(new QueryWrapper<UserAddr>().eq("user_id", userId));
        return new ResultVo(10000, "success", data);
    }

}
